﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<nelech.Models.DBModel.Place>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Html.Encode("נלך- " + Model.name) %>
</asp:Content>
<asp:Content ContentPlaceHolderID="Right" ID="Content4" runat="server">
    <p>
        <iframe src="http://www.israelweather.co.il/upload/weekly<%= Html.Encode(Model.Regeon.weather) %>.html"
            width="200" height="125" dir="rtl" name='in_frame' frameborder='0' scrolling='No'>
        </iframe>
    </p>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   <%var en = Model.Image.OrderBy(p => p.path, new nelech.Views.Shared.Code.ImagePathComparer()).GetEnumerator();
                %>
    <div id="main">
        <h2>
            <%= Html.Encode(Model.name) %></h2>
        <p class="print">
            <a href="javascript:window.print()">הדפס דף זה</a>
        </p>
        <fieldset>
            <legend>פרטים:</legend>
            <%if (Model != null && Model.Type != null)
              {%>
            <span class="bold">סוג המקום:</span>
            <%    foreach (var type in Model.Type)
                  {
                      Response.Write(type.text + ", ");
                  }
              }
            %><br />
            <span class="bold">בתשלום:</span>
            <%= Html.Encode(Model.Cost.text) %><br />
            <span class="bold">במפת סימון שבילים:</span>
            <%= Html.Encode(Model.Regeon.id + " - " + Model.Regeon.text) %>
            <% if (!string.IsNullOrEmpty(Model.annanLink))
               {%>
            <a href="<%= Model.annanLink%>" target="_blank">קישור למפה טופוגרפית באתר עמוד ענן</a>
            <%}%>
        </fieldset>
       
        <fieldset>
            <legend>תקציר:</legend>
            <div class="summary">
                <%= Html.Encode(Model.summary) %></div>
        </fieldset>
        <div class="description">
            <% if (en.Count() > 7 )
               { 
            %>
            <div class="gallerycontainer">
                <%
                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
                %>
                <a class="thumbnail" href="#thumb">
                    <p>
                        <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" height="130px" /><br />
                        <%=image.text%></p>
                    <span>
                        <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                        <br />
                        <%=image.text%>
                    </span></a>
            </div>
            <%} %>
            <%if (!String.IsNullOrEmpty(Model.coming))
              { %>
            <h3>
                איך מגיעים?</h3>
            <%= Model.coming %>
            <%}%>
            <% if (en.MoveNext())
               { 
            %>
            <div class="gallerycontainer">
                <%
                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
                %>
                <a class="thumbnail" href="#thumb">
                    <p>
                        <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" height="130px" /><br />
                        <%=image.text%></p>
                    <span>
                        <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                        <br />
                        <%=image.text%>
                    </span></a>
            </div>
            <%} %>
            <%if (!String.IsNullOrEmpty(Model.history))
              { %>
            <h3>
                קצת היסטוריה</h3>
            <%= Model.history %>
            <%} %>
            <% if (en.MoveNext())
               { 
            %>
            <div class="gallerycontainer">
                <%
                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
                %>
                <a class="thumbnail" href="#thumb">
                    <p>
                        <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" height="130px" /><br />
                        <%=image.text%></p>
                    <span>
                        <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                        <br />
                        <%=image.text%>
                    </span></a>
            </div>
            <%} %>
         
            <h3>
                פירוט:</h3>
            <%= Model.description %>
            <div id="map">
            </div>
            <p>
                המפה באדיבות WAZE - קהילת הנהגים של ישראל (ראה <a href="http://waze.co.il">waze.co.il</a>)</p>
            <%if (!String.IsNullOrEmpty(Model.nearby))
              { %>
            <h3>
                מקומות קרובים:</h3>
            <%= Model.nearby %>
            <%} %>
        </div>
        <% if (!string.IsNullOrEmpty(Model.map))
           { %>
        <p>
            <img src="<%= Model.map %>" />
        </p>
        <%} %>
        <%
            Html.RenderPartial("ListFeedback", ViewData["ListFeedbacks"]);%>
    </div>
     <div id="left">
        <div class="gallerycontainer">
            <% 
                 for (var i = 0; i < 7; i++)
                {
                    if (!en.MoveNext())
                        break;

                    var image = en.Current;
                    var smallImageName = System.IO.Path.GetFileName(image.path.Replace("\\", "/"));
            %>
            <a class="thumbnail" href="#thumb">
                <img src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= image.text %>" width="150px" /><br />
                <span>
                    <img src="<%= image.path %>" alt="<%= image.text %>" width="400px" />
                    <br />
                    <%=image.text%></span></a>
            <%=image.text%>
            <%
                }
            %>
        </div>
         <%Html.RenderAction("AdvertShow", "Advert", new { id = 7 });%>
    </div>
     <%
            
            Response.Write(
            "<script type=\"text/javascript\">\n" +
            "<!--\n" +
                "g_waze_config = {" +
                    "div_id:\"map\"," +
                    "locale : \"israel\"," +
                    "center_lon:" + Model.lon + "," +
                    "center_lat:" + Model.lat + "," +
                    "zoom:8," +
                    "token:\"44cc851e-2f08-46a3-ac5c-94ef96b0340f\"," +
                    "alt_base_layer:\"israel_colors\"," +
                    "alt_map_servers:\"http://ymap1.waze.co.il/wms-c/\"" +
                "};\n" +
            "-->\n" +
            "</script>");
        %>

    <script type="text/javascript" src="http://www.waze.co.il/js/WazeEmbeddedMap.js"></script>

    <!-- _DEBUG_INC_ -->

    <script type="text/javascript" src="/js/OpenLayers.js"> </script>

    <!-- _DEBUG_INC_ -->

    <script type="text/javascript" src="/js/jquery.js"></script>

    <!-- _DEBUG_INC_ -->

    <script type="text/javascript" src="/js/mapnik.js"></script>

    <!-- _DEBUG_INC_ -->

    <script type="text/javascript" src="/js/WazePanZoomBar.js"></script>

    <script type="text/javascript" src="http://www.waze.co.il/js/WazeEmbeddedMap.js"></script>

</asp:Content>
